package com.bothin.experiment4.dto;

import com.bothin.experiment4.enums.ProductFormStatusEnum;
import com.bothin.experiment4.enums.ProductFormTypeEnum;
import com.bothin.experiment4.model.LogistInfo;
import com.bothin.experiment4.utils.EnumUtil;
import lombok.Data;

import javax.persistence.Column;

/**
 * Created by bothin
 * At 2019/12/19 11:15
 * Description:
 */
@Data
public class ProductFormDTO  {
    private String formId;
    private String contactId;
    private String productId;

    /**
     * 当数量为负数且form_type为进货单时，表示缺货多少件
     */
    private Integer productQuantity;

    /**
     * 货单类型：0：发货单 1：进货单
     */
    private Integer formType;

    /**
     * 货单完成状态：0：未发货 1：运输中 2：已完成
     */
    private Integer finshStatus;


    private String productName;
    private String productIcon;
    private Integer productStock;

    private String customerName;
    private String customerAddress;

    private LogistInfo logistInfo;

    public ProductFormTypeEnum getProductFormTypeEnum(){
        return EnumUtil.getByCode(formType,ProductFormTypeEnum.class);
    }

    public ProductFormStatusEnum getProductFormStatusEnum(){
        return EnumUtil.getByCode(finshStatus,ProductFormStatusEnum.class);
    }

}
